﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BioWCF;
using BioModel;

namespace TestData
{
    public partial class Form1 : Form
    {
        IRemoteBookingSystem cli;
        public Form1()
        {
            cli = new RemoteBookingSystem();
            InitializeComponent();
            PopulateComboBox();
        }

        private void PopulateComboBox()
        {
            List<Sal> salListe = cli.AlleSal();
            BindingSource bindingSource = new BindingSource();
            bindingSource.DataSource = salListe;
            comboBox1.DataSource = bindingSource.DataSource;
            comboBox1.DisplayMember = "salNr";
            comboBox1.ValueMember = "salNr";
        }

        private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
        {
            if (comboBox1.SelectedItem != null)
            {
                // FilmId hentes fra filmComboBox.
                //film = filmComboBox.SelectedIndex + 1;
                //resultRichTextBox.Text += "Valgt film:\t\t" + filmComboBox.SelectedValue + "\n";
            }
        }
    }
}
